<%@page import="member.MemberVo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function getId(id){ return document.getElementById(id) }
function init(){
	getId('btnSubmit').onclick=function(){
		var p1 = frm.newPwd1.value; // 새로운암호
		var p2 = frm.newPwd2.value; // 확인 암호
		if(p1==p2){
			frm.action='MyHome.jsp?inc_content=./member/modify_result.jsp';
			frm.submit();
		}else{
			alert("새로운 암호가 서로 다릅니다.")
		}
	}
	getId('btnCancel').onclick=function(){
		
	}
}
</script>
</head>
<body>
<jsp:useBean id="bean" class="member.Login" scope="page"/>
<jsp:setProperty property="*" name="bean"/>
<%
MemberVo m = bean.view();
if(m==null){
	out.print("<li>관련 정보가 삭제되었거나 없습니다.");
	out.print("<li>회원조회 메뉴를 클릭한후 작업하세요.");
}
%>

<h1>회원정보 수정</h1>
<form name='frm' method='post' action=''>
	<label>아이디</label>
	<input type ='text' name='memberid' readonly value='<%=m.getMemberid() %>' ><br/>
	<label>기존암호</label>
	<input type ='text' name='pwd' value='<%=m.getPwd()%>'><p/>

	<label>새로운 암호</label>
	<input type ='password' name='newPwd1' ><br/>
	<label>암호 확인</label>
	<input type ='password' name='newPwd2'><p/>
	
	<input type='button' value='수정' id='btnSubmit'>
	<input type='button' value='취소' id='btnCancel'>

</form>

<script >init();</script>
</body>
</html>